package com.ay.smartpark.sdk.common.elasticjob.autoconfigure;//package com.ay.sdkclient.sdk.common.elasticjob.autoconfigure;
//
//import com.ay.sdkclient.sdk.common.elasticjob.parser.JobConfParser;
//import com.dangdang.ddframe.job.reg.zookeeper.ZookeeperConfiguration;
//import com.dangdang.ddframe.job.reg.zookeeper.ZookeeperRegistryCenter;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.context.properties.EnableConfigurationProperties;
//import org.springframework.context.annotation.Bean;
//
///**
// * 任务自动配置
// *
// * @author yinjihuan
// * @about http://cxytiandi.com/about
// */
//@EnableConfigurationProperties(ZookeeperProperties.class)
//public class JobParserAutoConfiguration {
//
//    @Autowired
//    private ZookeeperProperties zookeeperProperties;
//
//    /**
//     * 初始化Zookeeper注册中心
//     *
//     * @return
//     */
//    @Bean(initMethod = "init")
//    public ZookeeperRegistryCenter zookeeperRegistryCenter() {
//        ZookeeperConfiguration zkConfig = new ZookeeperConfiguration(zookeeperProperties.getServerLists(),
//                zookeeperProperties.getNamespace());
//        zkConfig.setBaseSleepTimeMilliseconds(zookeeperProperties.getBaseSleepTimeMilliseconds());
//        zkConfig.setConnectionTimeoutMilliseconds(zookeeperProperties.getConnectionTimeoutMilliseconds());
//        zkConfig.setDigest(zookeeperProperties.getDigest());
//        zkConfig.setMaxRetries(zookeeperProperties.getMaxRetries());
//        zkConfig.setMaxSleepTimeMilliseconds(zookeeperProperties.getMaxSleepTimeMilliseconds());
//        zkConfig.setSessionTimeoutMilliseconds(zookeeperProperties.getSessionTimeoutMilliseconds());
//        return new ZookeeperRegistryCenter(zkConfig);
//    }
//
//    @Bean
//    public JobConfParser jobConfParser() {
//        return new JobConfParser();
//    }
//
//}
